package com.feather.tenia.adapter.saver;

import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Types;

import com.feather.common.data.Column;
import com.feather.common.db.DbSaver;

/**
 * @author flogyin
 */
public class String_BLOB implements DbSaver {
	@Override
	@SuppressWarnings("rawtypes")
	public Class getJavaType() {
		return String.class;
	}

	@Override
	public String getDbType() {
		return "BLOB";
	}

	@Override
	public int getSqlType() {
		return Types.BLOB;
	}

	@Override
	public boolean matchNull() {
		return false;
	}

	@Override
	public boolean save(Object value, PreparedStatement statement, Column column) throws SQLException {
		statement.setObject(column.getOrdinal(), value);
		return true;
	}
}
